package com.sky.web.data1.user.controller;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.sky.web.data1.user.entity.Role;
import com.sky.web.data1.user.service.RoleService;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;

@RestController
@Api(description = "data1-角色")
public class RoleController {
	@Autowired
	private RoleService roleService;
	
	@ApiOperation(value = "获取角色") 
	@ApiImplicitParams({
		@ApiImplicitParam(name = "id" , value = "id" , paramType = "query" , required = false ),
		@ApiImplicitParam(name = "name" , value = "name" , paramType = "query" , required = false )
	})
	@RequestMapping(value="/getRoles", method = RequestMethod.GET)
	public List<Role> getRoles(Role role) {
		return roleService.getRoles(role);
	}

}
